import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

public class DateUtils {
    public static List<String> getLast12Months(){
        ArrayList<String> latest12Months = new ArrayList<>(12);
        LocalDate today = LocalDate.now();
        for(long i = 11L;i >=0L; i--){
            LocalDate localDate = today.minusMonths(i);
            String ss = localDate.toString().substring(0,7).replace("-","");
            latest12Months.add(ss);
        }
        return latest12Months;
    }
    public static void main(String[] args) {
        System.out.println(getLast12Months());
    }
}
